<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name=viewport content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<meta name=format-detection content="telephone=no">
<title>加载</title>
<style>
*{padding: 0;margin: 0;}
</style>
</head>
<body style="overflow: hidden;width: 100%;height:100%">
<img id="" src="images/loading.png" style="width: 100%;height:100%"/>

<script src="cordova.js"></script>
<script type="text/javascript">
if(window.location.href.indexOf("http")){
	var LOCAL_URL = window.location.href.substr(0, window.location.href.length-12);
}else{
	var LOCAL_URL = "/";
}
var app = {
	transindex : function() {
		//alert('transindex'+window.templatedowncount);
		location.replace(LOCAL_URL + 'index.html');
	},
	// Application Constructor
	initialize : function() {
		this.bindEvents();
	},
	// Bind Event Listeners
	//
	// Bind any events that are required on startup. Common events are:
	// 'load', 'deviceready', 'offline', and 'online'.
	bindEvents : function() {
		document.addEventListener('deviceready', this.onDeviceReady, false);
	},
	// deviceready Event Handler
	//
	// The scope of 'this' is the event. In order to call the 'receivedEvent'
	// function, we must explicitly call 'app.receivedEvent(...);'
	onDeviceReady : function() {
		try {
			//alert('onDeviceReady');
			//推送
			//window.plugins.jPushPlugin.init(); 
			//window.plugins.jPushPlugin.setDebugMode(true);
			
			app.transindex();
		} catch (e) {
			alert(e.message);
			app.transindex();
			console.log(e);
		}
	},
	// Update DOM on a Received Event
	receivedEvent : function(id) {
		console.log('Received Event: ' + id);
	}
};

app.initialize();
</script>
</body>
</html>
